#pragma once
#include "Report.h"
#include "UpgraDev.h"
#include "UsbHid.h"

#define	MAX_ACC			1200

class Upgrade;

class Foxdev:public UsbHid{
private:
	static UsbHid*	create(HDEVINFO,SP_DEVICE_INTERFACE_DATA*);

	uint		accKey;
	uint		offset;
	Report		report;
	uint		steps;
	uint		tick;
	UpgraDev	upgrade;
	ushort		upgOrd;
	TCHAR		url[MAX_PATH];
	ushort		version;
	ushort		voltB;
	ushort		voltC;
	ushort		voltS;

	Foxdev	(HDEVINFO,SP_DEVICE_INTERFACE_DATA*);

	ushort	loadBin		(void);
	void	sendReport	(Report*);
	void	single		(ushort,ushort);
	void	multiple	(void);

protected:
	virtual uint threadEntry(void);

public:
	static void	cleanup		(void);
	static void	openAll		(void);
};